package com.bruce.tool;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
 * 
 * @Description:拦截过滤器
 * @author JW
 * @date:   2019年3月12日 上午9:15:33
 */
@SuppressWarnings("deprecation")
@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter {
	/**
	 * 配置拦截器
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(createMyInterceptor1()).addPathPatterns("/**/**");
	}
	/**
	 * MyInterceptor1注入bean
	 * @return
	 */
	@Bean
	public MyInterceptor1 createMyInterceptor1() {
		return new MyInterceptor1();
	}
	
}
